using Godot;

namespace Box.Base {
    public partial class TileSetMulti : TileSet {
        public void AddTileSet(TileSet tileset) {
            int source_count = tileset.GetSourceCount();
            
            if(GetPhysicsLayersCount() < tileset.GetPhysicsLayersCount()) {
                for(int i = 0;i<tileset.GetPhysicsLayersCount();i++) {
                    AddPhysicsLayer();
                }
            }

            for(int i = 0;i < source_count;i++) {
                TileSetAtlasSource source = tileset.GetSource(tileset.GetSourceId(i)) as TileSetAtlasSource;
                int tile_count = source.GetTilesCount();
                AddSource(source);
            }
        }
    }
}